package com.bw.product.server.controller;

import com.bw.common.core.domain.Result;
import com.bw.product.common.domain.Goods;
import com.bw.product.server.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("goods")
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    @GetMapping("list")
    public Result list(){
        List<Goods> goods = goodsService.selectGoods();
        return Result.success(goods);
    }

}
